#pragma once

#include <unordered_map>
#include <string>
#include <memory>

struct Texture {
	unsigned int id;
	std::string name;
	int width,height,numberComponents;
	bool bFlip;

	Texture(std::string _name, bool flip = true) {
		name = _name;
		bFlip = flip;
	}

};
class ResourceManager
{
public:

	ResourceManager();

	inline static ResourceManager& Get() { static ResourceManager s_Instance;return s_Instance; }
		
	void AddTexture(std::shared_ptr<Texture> texture) { m_Textures[texture->name]=texture; }
	void RemoveTexture(std::string name) { m_Textures.erase(m_Textures.find(name)); }
	std::shared_ptr<Texture> FindTexture(std::string name) { return m_Textures[name]; }

	std::unordered_map<std::string, std::shared_ptr<Texture>> GetAllTextures() { return m_Textures; }

private:
	void _loadTexture();

	std::unordered_map<std::string, std::shared_ptr<Texture> > m_Textures;

};